/**
 * @description 定义门店请求
 */

import {
    SHOP_LIST_URL,
    SHOP_ADD_URL,
    USER_LIST_URL,
    SHOP_UPDATE_URL,
    SHOP_RECORDS_URL,
    SHOP_RECORDSADD_URL,
    SHOP_ANALYSIS_STORE_URL,
    SHOP_MERITS_URL
} from '@/config/shop.config'

import ajax from './ajax'

export function shopListApi() {
    return ajax({
        url: SHOP_LIST_URL
    })
}

export function shopAddtApi(data) {
    return ajax({
        url: SHOP_ADD_URL,
        data,
        method: 'PUT'
    })
}


export function shopRecordsApi(params) {
    return ajax({
        url: SHOP_RECORDS_URL,
        params,
    })
}
export function userListApi(params) {
    return ajax({
        url: USER_LIST_URL,
        params
    })
}

export function shopMeritsApi(params) {
    return ajax({
        url: SHOP_MERITS_URL,
        params
    })
}

export function shopRecordsAdd(data) {
    return ajax({
        url: SHOP_RECORDSADD_URL,
        data,
        method: 'PUT'
    })
}

export function shopUpdateApi(data) {
    return ajax({
        url: SHOP_UPDATE_URL,
        method: 'POST',
        data
    })
}

export function analysisStoreApi(type) {
    return ajax({
        url: SHOP_ANALYSIS_STORE_URL,
        params: {
            type
        }
    })
}
